<html>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript">
        function enter(){
            $.ajax({
                type:"get",
                url:"/chat",
                data:{data:document.getElementById("input").value},
                datatype:"json",
                success:function(data){
                    json_data = JSON.parse(data)
                    $('#show').append(json_data.content+"\r\n")
            }})
        }
    </script>
    <body>
        <div>
            <textarea id="show" style="width: 100%;height: 400px;"></textarea>
            <input id="input" type="text" style="width:100%;margin-top: 10px;" 
                onkeydown="if(event.keyCode==13) {enter()}"/>
        </div>
    </body>
</html>